<?php
	 require_once ("db_connection.php");
	 
	$id = "RL-" . uniqid();
	$dest = $_POST['destination'];
	$hr = $_POST['minimumhr'];
	$type = $_POST['typerate'];
	
	$query = "INSERT INTO ralimoratesdetail(id, vehicletype, ralimorateid, ratetype, destination, minimumhr, currency, rate)
		VALUES('$id', '$_POST[vehicle]', '$_POST[ralimorateid]', '$type' ,'$dest', '$hr' ,'$_POST[currency]', '$_POST[rate]')";

	if(!mysql_query($query, $con)) {
		die('Error: '. mysql_error());
	}
	
	$data = array("Saved!", $id);
	
	mysql_close($con);
	
	echo json_encode($data);
	flush();
?>